.Polaris--hidden {
  display: none !important;
}

/* Add missing 1/4 section for layout */
@media (min-width: 30.625em) {
  .Polaris-Layout__Section--oneFourth {
    flex: 1 1 13rem;
    min-width: 0;
  }
}

/* Fix Tag removal link */
a.Polaris-Tag__Button {
  height: auto;
}

/* Remove underline for sort link */

.Polaris-DataTable__Cell--sortable a {
  text-decoration: none;
}

/* Card */

.Polaris-LegacyCard {
  overflow: initial;
}

html[class~="Polaris-Summer-Editions-2023"] {
  .Polaris-LegacyCard__Section--borderTop {
    border-top: 0.1rem solid var(--p-color-border-subdued) !important;
    padding-top: var(--p-space-300) !important;
  }

  .Polaris-LegacyCard__Section:has(+.Polaris-LegacyCard__Section--borderTop) {
    padding-bottom: var(--p-space-300) !important;
  }

  .Polaris-LegacyCard__Section--borderBottom {
    border-bottom: 0.1rem solid var(--p-color-border-subdued) !important;
    padding-bottom: var(--p-space-300) !important;

    & + .Polaris-LegacyCard__Section {
      padding-top: var(--p-space-300) !important;
    }
  }
}

/* IndexTable */

/* TestStyle sizes */
.Polaris-TextStyle--sizeSmall {
  font-size: 1.25rem;
}

/* Remove focus styles for non-keyboard focus from buttons and links */
.Polaris-Button, .Polaris-Breadcrumbs__Breadcrumb {
  &:focus:not(:focus-visible)::after {
    box-shadow: none !important;
  }
}
.Polaris-LegacyTabs__Tab {
  &:focus:not(:focus-visible) > .Polaris-LegacyTabs__Title::after {
    box-shadow: none !important;
  }
}

/* Popover */
.Polaris-Popover {
  margin: 0;
}

.Polaris-Popover__PopoverOverlay--closed {
  visibility: hidden;
  pointer-events: none;
}

/* Filters */
.Polaris-LegacyFilters-ConnectedFilterControl__RightContainer {
  .Polaris-LegacyFilters-ConnectedFilterControl__Item {
    z-index: auto;

    & > div > div > button {
      margin-right: -1px;
      border-radius: 0;
    }

    &:first-of-type > div > div > button {
      border-top-left-radius: var(--p-border-radius-1);
      border-bottom-left-radius: var(--p-border-radius-1);
    }
  }

  &.Polaris-LegacyFilters-ConnectedFilterControl--queryFieldHidden {
    .Polaris-LegacyFilters-ConnectedFilterControl__Item:first-of-type > div > div > button {
      border-top-left-radius: var(--p-border-radius-1);
      border-bottom-left-radius: var(--p-border-radius-1);
    }
  }
}

.Polaris-LegacyFilters-ConnectedFilterControl__RightContainerWithoutMoreFilters {
  .Polaris-LegacyFilters-ConnectedFilterControl__Item:last-child > div > div > button {
    border-top-right-radius: var(--p-border-radius-1);
    border-bottom-right-radius: var(--p-border-radius-1);
  }
}

/* Toast */
.Polaris-Frame-ToastManager {
  bottom: 0;
}

/* Autocomplete */

.Polaris-Autocomplete__EmptyState {
  padding: 0.8rem 1.6rem;
}

/* DropZone */
.Polaris-DropZone {
  &__Preview {
    padding: 1.5rem;
    display: flex;
    height: 100%;

    &--singleFile {
      align-items: center;
      text-align: center;
      justify-content: center;
    }

    &--sizeMedium {
      justify-content: center;
      text-align: center;

      .Polaris-LegacyStack.Polaris-LegacyStack--alignmentCenter {
        justify-content: center;
      }
    }

    &--sizeSmall {
      padding: 0;
      justify-content: center;

      .Polaris-Thumbnail {
        border: none;

        img {
          width: 100%;
          object-fit: cover;
        }
      }
    }
  }

  &__Loader {
    display: flex;
    height: 100%;
    align-items: center;
    text-align: center;
    justify-content: center;

    .Polaris-Spinner--sizeSmall {
      height: 20px;
    }
  }
}

/* ActionMenu */
.Polaris-ActionMenu {
  &--mobile {
    @media (min-width: 768px){
      display: none;
    }
  }

  &--desktop {
    display: none;

    @media (min-width: 768px){
      display: block;
    }
  }
}

/* Page Pagination */
@media (max-width: 768px){
  .Polaris-Page-Header__PaginationWrapper {
    display: none;
  }
}

/* EmptySearchResults */
.Polaris-EmptySearchResults {
  padding: 84px 0;

  &__Content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ActionList */

.Polaris-ActionList__Item {
  border: none !important;
}

/* ResourceItem Actions + Disclosure */

.Polaris-ResourceItem__Actions {
  display: none;
}
.Polaris-ResourceItem:hover .Polaris-ResourceItem__Actions {
  display: flex;
}
@media (max-width: 45em), (min-width: 48.0625em) and (max-width: 61.5em) {
  [data-has-navigation] .Polaris-ResourceItem__Actions {
    display: none !important;
  }
}
@media (max-width: 46.5em) {
  .Polaris-ResourceItem__Actions {
    display: none !important;
  }
}

.Polaris-ResourceItem--persistActions .Polaris-ResourceItem__Actions {
  display: flex;
}
@media (max-width: 45em), (min-width: 48.0625em) and (max-width: 61.5em) {
  [data-has-navigation] .Polaris-ResourceItem--persistActions .Polaris-ResourceItem__Actions {
    display: none !important;
  }
}
@media (max-width: 46.5em) {
  .Polaris-ResourceItem--persistActions .Polaris-ResourceItem__Actions {
    display: none !important;
  }
}

.Polaris-ResourceItem__Disclosure {
  position: relative;
  top: -0.7rem;
  right: -1.65rem;
  display: none;
  width: 4.8rem;
  pointer-events: initial;
}
.Polaris-ResourceItem--selectMode .Polaris-ResourceItem__Disclosure {
  display: none;
}
@media (max-width: 45em), (min-width: 48.0625em) and (max-width: 61.5em) {
  [data-has-navigation] .Polaris-ResourceItem__Disclosure {
    display: flex;
    flex: 0 0 4.8rem;
    justify-content: center;
    align-items: center;
  }
}
@media (max-width: 46.5em) {
  .Polaris-ResourceItem__Disclosure {
    display: flex;
    flex: 0 0 4.8rem;
    justify-content: center;
    align-items: center;
  }
}

/* Polaris-VisuallyHidden */

.Polaris-VisuallyHidden {
  position: absolute !important;
  top: 0;
  width: 0.0625rem !important;
  height: 0.0625rem !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Frame - TopBar */

.Polaris-Frame__TopBar {
  .Polaris-TopBar-SearchField > div {
    width: 100%;
  }
}
